using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using EntLibEC.Cmn;
using EntLibEC.Biz;

namespace EntLibEC.View.Cmn
{
    public partial class NewsType : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void BindNewsType(bool isAll)
        {
            ddlNewsType.Items.Clear();
            ddlNewsType.DataSource = AppEnum.GetNewsType();
            ddlNewsType.DataValueField = "key";
            ddlNewsType.DataTextField = "value";
            ddlNewsType.DataBind();
            if (isAll)
                ddlNewsType.Items.Insert(0, new ListItem(AppConst.AllSelectString, AppConst.IntNull.ToString()));
        }


        public int NewsTypeSysNo
        {
            get
            {
                return Convert.ToInt32(ddlNewsType.SelectedItem.Value);
            }
            set
            {
                ddlNewsType.SelectedIndex = ddlNewsType.Items.IndexOf(ddlNewsType.Items.FindByValue(value.ToString()));
            }
        }
    }
}